#ifndef __GameManager_H__
#define __GameManager_H__

#include <string>
#include <vector>

class Dict;

class Game
{
public:
	Game()
		:curRound(0)
	{
		// self
		scores[0][0] = -1;
		scores[0][1] = -1;
		scores[0][2] = -1;

		// opponent
		scores[1][0] = -1;
		scores[1][1] = -1;
		scores[1][2] = -1;
	}
	std::string gameCookie;

	std::string opeonentName;

	int curRound;

	std::vector<std::string> letters;

	int scores[2][3];
};

class GameManager
{
public:
	~GameManager();

	static GameManager& getInstance();

	std::string mCurrentGameCookie;

	std::string mPlayerCookie;

	Game* create(const std::string& gameCookie);

	Game* getGame(const std::string& gameCookie);

	Game* getCurrentGame();

	bool loadDict(const char* dictFileName);

	bool isWord(const std::string& word);

private:
	GameManager();

	std::vector<Game*> mGames;

	Dict* mDict;
};

#endif // __GameManager_H__